﻿<%template _header%>
<%namespace YouHP.Model%>


<div class="layout-cols2">
<%template _memmenu%>
	<div class="pannelcontent">

		<div class="pcontent">
		<div class="panneldetail">
	     <%template _memrecordermenu%>
	     	
			<div class="pannelbody">
	    <%csharp%>if( IsPost){ <%/csharp%>
	    
	    <%template _MsgBox%>
	    
	    <%csharp%> } else { <%/csharp%>
	    
	    <div class="box">
	        <div class="caption">
	            哮喘控制修改
	        </div>
	        <div class="content">
	            <form method="post" id="prdata">
	               <table class="table-box">
	                <tr>
	                    <td class="table-box-left">时间</td>
	                    <td class="table-box-right" colspan="5">
	                       <input class="box-var validate-date" id="date" maxlength="10" size="10" name="date"  readonly="true" value="{sDate}" style="vertical-align:middle;"/>
	                </tr>
                    <tr>
                        <td colspan="6">1. 在过去4周内，在工作、学习或家中，有多少时候哮喘妨碍您进行日常活动？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_1_1" name="indicator1" value="1"/>所有时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_2" name="indicator1" value="2"/>大多数时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_3" name="indicator1" value="3"/>有些时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_4" name="indicator1" value="4"/>很少时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_5" name="indicator1" value="5"/>没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">2. 在过去4周内，您有多少次呼吸困难？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_2_1" name="indicator2" value="1"/>每天不止1次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_2" name="indicator2" value="2"/>每天1次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_3" name="indicator2" value="3"/>每周3至6次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_4" name="indicator2" value="4"/>每周1至2次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_5" name="indicator2" value="5"/>完全没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">3. 在过去4周内，因为哮喘症状（喘息、咳嗽、呼吸困难、胸闷或疼痛）， 您有多少次在夜间醒来   或早上比平时早醒？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_3_1" name="indicator3" value="1"/>每周4晚或更多</td>
                        <td><input type="radio" id="ID_INDICATOR_3_2" name="indicator3" value="2"/>每周2至3晚 </td>
                        <td><input type="radio" id="ID_INDICATOR_3_3" name="indicator3" value="3"/>每周1次</td>
                        <td><input type="radio" id="ID_INDICATOR_3_4" name="indicator3" value="4"/>1至2次</td>
                        <td><input type="radio" id="ID_INDICATOR_3_5" name="indicator3" value="5"/>没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">4. 在过去4周内，您有多少次使用急救药物治疗（如沙丁胺醇）？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_4_1" name="indicator4" value="1"/>每天3次以上</td>
                        <td><input type="radio" id="ID_INDICATOR_4_2" name="indicator4" value="2"/>每天1至2次 </td>
                        <td><input type="radio" id="ID_INDICATOR_4_3" name="indicator4" value="3"/>每周2至3次</td>
                        <td><input type="radio" id="ID_INDICATOR_4_4" name="indicator4" value="4"/>每周1次或更少</td>
                        <td><input type="radio" id="ID_INDICATOR_4_5" name="indicator4" value="5"/>没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">5. 您如何评价过去4周内，您的哮喘控制情况？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_5_1" name="indicator5" value="1"/>没有控制</td>
                        <td><input type="radio" id="ID_INDICATOR_5_2" name="indicator5" value="2"/>控制很差</td>
                        <td><input type="radio" id="ID_INDICATOR_5_3" name="indicator5" value="3"/>有所控制</td>
                        <td><input type="radio" id="ID_INDICATOR_5_4" name="indicator5" value="4"/>控制很好</td>
                        <td><input type="radio" id="ID_INDICATOR_5_5" name="indicator5" value="5"/>完全控制</td>
                    </tr>
                    <tr>
                        <td colspan="6" align="center"><input type="button" onclick="OnUpdateHistory();" value="提交"/></td>
                    </tr>
                </table>  
	            </form>
	        </div>
	    </div>
	    
	    <%csharp%> } <%/csharp%>
	    
	</div>
	
</div>
</div>
</div>
</div>
<script>
    function gettypevalue() {
    function check(index) {
        for (var i = 1; i <= 5; ++i)
            if (_$("ID_INDICATOR_"+index+"_" + i).checked) return i;
        return -1;
    }
    var types = [];
    for (var i = 1; i <= 5; ++i) {
        types.push(check(i));
    }
    return types;
}
    function init() {
        var vSelect = "{sIndicator}".split(',');
        if (vSelect.length != 5) return;
        for (var i = 1; i <= 5; ++i) {
            _$("ID_INDICATOR_" + i + "_" + vSelect[i-1]).checked = true; 
        }
    }
    function OnUpdateHistory() {
        <%csharp%> string sId = oXiaoChuanInfo.Id.ToString();<%/csharp%>
        var surl = "/pages/alpha/XiaoChuanHistory/XiaoChuanUpdate.aspx?type=1&id=" + "{sId}";
        var typevalues=gettypevalue();
        var index = typevalues.find(-1);
        if (index != null) {
            alert("请选择第" + (index+1) + "项");
            return;
        }
        var value = typevalues.join(',');
        var date = _$("date").value ; 
        surl = surl+"&&date="+date.escUrl()+"&&value="+value ;
        function OnSuc(xmlDoc) {
            alert("操作成功");
            window.location.href = "index.aspx";
        }
        function OnFail(xmlDoc) {
            var result = xmlDoc.getElementsByTagName("result")[0];
            retMsg = result.getAttribute("msg");
            alert(retMsg);
        }
        function OnError() {
            alert("操作失败，请稍后再试");
        }
        getResultXml(surl, OnSuc, OnFail, OnError);
    }
    init();
</script>

<%template _footer%>